Naive Bayes classifier in Python